package com.rms.service.impl;

import com.rms.entity.Board;
import com.rms.mapper.BoardMapper;
import com.rms.service.BoardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

/**
 * @author 胡满意
 * @date 2019/10/28
 */
@Service
public class BoardServiceImpl implements BoardService {
    @Autowired
    private BoardMapper boardMapper;

    @Override
    public List<Board> selectAllBoard(){
        return boardMapper.selectAllBoard();
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int insertBoard(String boardName){
        return boardMapper.insertBoard(boardName);
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int deleteBoard(int boardId){
        return boardMapper.deleteBoard(boardId);
    }
    @Override
    public int unsubscribeBoard(int boardId){
        return boardMapper.unsubscribeBoard(boardId);
    }
    @Override
    public int orderBoard(int boardId, Date boardTime){
        return boardMapper.orderBoard(boardId,boardTime);
    }
}

